<?php
import('baseview.class.php');

define('POLL_S_OK',500);
define('POLL_F_NEED_LOGIN', 521);
define('POLL_F_UNKOWN_REASON', 522);

class ViewPoll extends BaseView{


	public function getViewByCode($code){
		switch ($code){
			case POLL_F_NEED_LOGIN:
				return parent::getFailedView(POLL_F_NEED_LOGIN, 'Login first.');
				break;
			case POLL_F_UNKOWN_REASON:
			default:
				return parent::getFailedView(POLL_F_UNKOWN_REASON, 'Unkown reason.');

		}
	}

	public function getMsgView($msg){
		$bview = parent::getSuccessView(POLL_S_OK, '');
		$view = BaseView::mergeViews($bview, array('content'=>$msg));
		return $view;
	}
}